<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../vue.global.js"></script>
</head>

<body>
    <div id="bind-attribute">
        <!-- title属性实时同步组件的message数据 -->
        <span v-bind:title="message">
            鼠标悬停几秒钟查看此处动态绑定的提示信息！
        </span>
    </div>

    <script>
        const AttributeBinding = {
          data() {
            return {
              message: "You loaded this page on " + new Date().toLocaleString(),
            };
          },
  
          /* Counter组件【挂载完毕】时回调mounted【生命周期】 */
          mounted() {
            setInterval(() => {
              this.message = "You loaded this page on " + new Date().toLocaleString();
            }, 1000);
          },
  
        };
  
        Vue.createApp(AttributeBinding).mount("#bind-attribute");
      </script>
</body>

</html>